package com.ruoyi.mall.app.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mall.app.service.DtsArticleService;
import com.ruoyi.mall.common.domain.DtsArticle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.ruoyi.common.core.domain.AjaxResult.success;

@RestController
@RequestMapping("/api/index/article")
public class DtsArticleController extends BaseController {

    @Autowired
    private DtsArticleService dtsArticleService;

    @GetMapping("/articleList")
    public AjaxResult articleList(DtsArticle dtsArticle)
    {
        List<DtsArticle> list = dtsArticleService.selectAll(dtsArticle);
        if (list != null){
            return success(list);
        }else {
            return error();
        }
    }
}
